package com.aaa.service.mht.impl;

import com.aaa.dao.mht.TmhtPlaneMapper;
import com.aaa.entity.MyPage;
import com.aaa.entity.TmhtPlane;
import com.aaa.service.mht.TmhtPlaneService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (TmhtPlane)表服务实现类
 *
 * @author yuyongli
 * @since 2022-10-25 15:46:56
 */
@Service
public class TmhtPlaneServiceImpl implements TmhtPlaneService {
   @Autowired
   private TmhtPlaneMapper tmhtPlaneMapper;

   @Override
   public PageInfo queryAll(MyPage myPage) {
      PageHelper.startPage(myPage.getPage(),myPage.getLimit());

      return new PageInfo(tmhtPlaneMapper.selectAllData());
   }

    @Override
    public boolean selectPlane(TmhtPlane plane) {
        List<TmhtPlane> select = tmhtPlaneMapper.select(plane);
        return select.size()==0;
    }

    @Override
    public boolean insertPlane(TmhtPlane plane) {

       return tmhtPlaneMapper.insert(plane)>0;
    }

    @Override
    public TmhtPlane queryByQyCode(TmhtPlane tmhtPlane) {

        TmhtPlane tmhtPlane1 = tmhtPlaneMapper.selectOne(tmhtPlane);

        return tmhtPlane1;
    }
}

